<?php

require __DIR__.'/../../../vendor/autoload.php';

use Gateway\app\livingdetect\LivingdetectInitRequest;
use Gateway\ESGateway;
use Gateway\JSONUtil;
use Gateway\Log;

$appCode = "d2808c1338ce01f3e3efdb486f9effb9";
$algo = "3";
$key = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhdQdw6uTGz+X4e+/eGpu4dcKrfrjQAe0tTQyn6TuKBobcsUsESkx9jcCeG4cpuxmN8jNeDAZsbTujNLD/aYl2g==";
$esGateway = new ESGateway($appCode, $algo, $key);

$livingdetectInitRequest = new LivingdetectInitRequest();
$livingdetectInitRequest->initMsg = "@Android,2,8,1658484566@NibhdDZK9ja0gwaTLRo5KpckYi6y6tRCjWFqAMZZzNNeLSsfNtVddN8/dzI6HJFUp+tg1c0Qc1DqpP/CDriJlOKEgcGvlXLUP3fhv2wYGwT0SDRAv1x2obTbWn6N0AVhHkUApE1GjEZlSVHPQn350vSUa8a/Hm4RBW7D0Uu8BjcR6FS8Q/7j2klpH0lRTmsZI7oxUA2qAfX7pZ7e068ZR613bdSzwbkSvaer7sSqmJnMwvp0f3oRZ5ZC0NrUuK2WPkETzzklCbUhE24yB1e3xN11HG52HX+/MfyHuzPGoLGNd4VfPzfaul+m6hfl3Aaoy8VE9tjk7ewdaM8TtsDN4BMvcAJ75CKjfxCdkXOqdq2XVXtmMnGNjse0DpZfzhFko3G1HtOCPliU+b5ytIB0DNi/aA2ec0Ojgqu0JUjkilxq52jIns05Cj6eDJ+MeOWc1pauxmBH8qkKLPK7VCQxpYRn8PphMLcv6+w6Nc92rEjXGN4gL6bndjrnMEpPeK/eUf+Oq9TfYQ7YyBWOIPse8GJTNcZocxR3j8KRHeO70j0dDme+DJqDblcz2yU2AzgV1Gm6VR8rDw3fN1KkMVgc9w==";

$gatewayResponse = $esGateway->sendToGateWay(LivingdetectInitRequest::$act,$livingdetectInitRequest->toJsonStr());
Log::DEBUG("服务器返回数据：".$gatewayResponse->toJsonStr());
if ($gatewayResponse->bizContent != null) {
    Log::DEBUG("业务数据为：".$gatewayResponse->bizContent);
    $rsp = JSONUtil::fromJsonStr($gatewayResponse->bizContent);
}

